package com.minelx.statementplus.ui.form.dao;

import com.minelx.woods.task.core.values.FieldPathValues;

import java.util.ArrayList;
import java.util.List;

import static java.util.Collections.unmodifiableList;

public class TableAndFieldValuesListModel extends BaseListModel<FieldPathValues> {

	private final List<FieldPathValues> store;

	public TableAndFieldValuesListModel() {
		store = new ArrayList<>();
	}

	public List<FieldPathValues> toList() {
		return unmodifiableList(store);
	}

	public boolean contains(FieldPathValues element) {
		return store.contains(element);
	}

	@Override
	public int getSize() {
		return store.size();
	}

	@Override
	public FieldPathValues getElementAt(int index) {
		return store.get(index);
	}

	@Override
	protected void append(FieldPathValues file) {
		store.add(file);
	}

	@Override
	protected void remove(int index) {
		store.remove(index);
	}

	@Override
	public void removeAll() {
		store.clear();
	}
}
